"""
    @Author  ：思念 
    @File    ：13.不获取任务返回值的情况下堵塞主线程.py
    @Date    ：2025/3/6 14:58 
"""
"""
    @Author  ：思念 
    @File    ：11.线程池.py
    @Date    ：2025/3/4 10:04 
"""

from concurrent.futures import ThreadPoolExecutor,wait


url = 'https://movie.douban.com/top250?start={}&filter='

def get_movie_info(url):
    print("爬取地址URL为:", url)

# 1.创建线程池对象
pool = ThreadPoolExecutor()
# 2.提交任务
url_list = [url.format(i*25) for i in range(10)]
futures = [pool.submit(get_movie_info, url_list)]

# 3.主线程堵塞
wait(futures)

print("主线程结束")